import request from '@/utils/request'
const BusinessFormValueService = {
  state: {},

  mutations: {},

  actions: {
    /**
     * 提交的表单数据分页
     */
    businessFormValuePage({ commit }, params) {
      return new Promise((resolve, reject) => {
        request.get('businessFormValue/page', params).then(response => {
          resolve(response)
        }).catch(error => {
          reject(error)
        })
      })
    },
    /**
    * 根据主键获得提交的表单数据
    */
    businessFormValueGetById({ commit }, id) {
      return new Promise((resolve, reject) => {
        request.get('businessFormValue/getById/' + id).then(response => {
          resolve(response)
        }).catch(error => {
          reject(error)
        })
      })
    },
    /**
    * 根据主键获得提交的表单数据详情
    */
    businessFormValueGetDetailsById({ commit }, id) {
      return new Promise((resolve, reject) => {
        request.get('businessFormValue/getDetailsById/' + id).then(response => {
          resolve(response)
        }).catch(error => {
          reject(error)
        })
      })
    },

    /**
     * 提交的表单数据保存
     */
    businessFormValueSave({ commit }, params) {
      return new Promise((resolve, reject) => {
        request.post('businessFormValue/save', params).then(response => {
          resolve(response)
        }).catch(error => {
          reject(error)
        })
      })
    },
    /**
     * 提交的表单数据更新
     */
    businessFormValueUpdate({ commit }, params) {
      return new Promise((resolve, reject) => {
        request.post('businessFormValue/update/' + params.id, params).then(response => {
          resolve(response)
        }).catch(error => {
          reject(error)
        })
      })
    },
    /**
     * 提交的表单数据删除
     */
    businessFormValueRemove({ commit }, params) {
      return new Promise((resolve, reject) => {
        request.post('businessFormValue/remove', params).then(response => {
          resolve(response)
        }).catch(error => {
          reject(error)
        })
      })
    }
  }
}

export default BusinessFormValueService
